<template>
    <div class="filter-container">
        <nut-tabs v-model="selected" title-scroll title-gutter="10">
            <nut-tab-pane v-for="item in tabList" :title="item.name"></nut-tab-pane>
        </nut-tabs>

    </div>
</template>
<script setup>
import { ref, watch, toRefs } from 'vue'
const props = defineProps({
    tabList: Array,
    listType: Number
})
const emit = defineEmits(["onChange"])
const { tabList, listType } = toRefs(props);
const selected = ref(0)
selected.value = listType.value
watch(selected, (index) => {
    emit("onChange", tabList.value[index])

})
</script>
<style lang="less">
.filter-container {
    .nut-tabs__content {
        display: none !important;
    }

    .nut-tabs__titles {
        background: #ffffff !important;

        .nut-tabs__titles-item {
            .nut-tabs__titles-item__smile {
                display: none;
            }

            .nut-tabs__titles-item__text {
                color: #858a99;
                font-size: 22px;
            }
        }

        .nut-tabs__titles-item__line {
            background: linear-gradient(to right, #5232B7, #7237BC, #5232B7) !important;
            border-radius: 30px !important;
        }



        .nut-tabs__titles-item.active {
            .nut-tabs__titles-item__smile {
                display: block;
                margin-top: 10px !important;
            }

            .nut-tabs__titles-item__text {
                color: #5232B7 !important;
            }
        }
    }

}
</style>